home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / DRAW_EX.BAS < prev    next >
BASIC Source File  |  1988-09-17  |  979b  |  41 lines

  1. ' *** DRAW_EX.BAS ***
  2. '
  3. ' Declare procedure.
  4. DECLARE SUB Face (Min$)
  5. '
  6. ' Select 640 x 200 pixel high-resolution graphics screen.
  7. SCREEN 2
  8. DO
  9.    CLS
  10.    ' Get string containing minutes value.
  11.    Min$ = MID$(TIME$,4,2)
  12.    ' Draw clock face.
  13.    Face Min$
  14.    ' Wait until minute changes or a key is pressed.
  15.    DO
  16.       ' Print time at top of screen.
  17.       LOCATE 2,37
  18.       PRINT TIME$
  19.       ' Test for a key press.
  20.       Test$ = INKEY$
  21.    LOOP WHILE Min$ = MID$(TIME$,4,2) AND Test$ = ""
  22. ' End program when a key is pressed.
  23. LOOP WHILE Test$ = ""
  24. END
  25. '
  26. ' Draw the clock face.
  27. SUB Face (Min$) STATIC
  28.    LOCATE 23,30
  29.    PRINT "Press any key to end"
  30.    CIRCLE (320,100),175
  31.    ' Convert strings to numbers.
  32.    Hr = VAL(TIME$)
  33.    Min = VAL(Min$)
  34.    ' Convert numbers to angles.
  35.    Little = 360 - (30 * Hr + Min/2)
  36.    Big = 360 - (6*Min)
  37.    ' Draw the hands.
  38.    DRAW "TA=" + VARPTR$(Little) + "NU40"
  39.    DRAW "TA=" + VARPTR$(Big) + "NU70"
  40. END SUB
  41.